{{extend "layout_admin.html"}}

{{block css}}{{end}}

{{block title}}
<i class="fa fa-coffee fa-fw"></i> 项目管理
{{end}}

{{block content}}
<div class="row">
    <div class="col-lg-12">
        <button type="button" class="btn btn-primary btn-lg" id="btn-add-proj"><span class="fa fa-plus fa-fw"></span> 追加新项目</button>
    </div>
</div>
<br>
<div class="row">
    {{for proj in projs:}}
    <div class="col-lg-4">
        <div class="panel panel-info">
            <div class="panel-heading">
                <h3 class="panel-title"><a href="/admin/proj-edit/{{=proj.id}}">项目名称: {{=proj.name}}</a></h3>
            </div>
            <div class="panel-body">
                <p>项目描述</p>
                <table class="table table-striped table-hover">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>项目组成员</th>
                        </tr>
                    </thead>
                    <tbody>
                        {{order = 1}}
                        {{for user in proj.users:}}
                        <tr>
                            <td>{{=order}}</td>
                            <td>{{=user.real_name}}</td>
                        </tr>
                        {{order += 1}}
                        {{pass}}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    {{pass}}
</div>
{{end}}

{{block js}}
<script type="text/javascript">
    $(function(){
        $("#btn-add-proj").click(function() {
            location.href = "/admin/proj-edit/0";
        });
    });
</script>
{{end}}
